﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Century.Model;
using Century.Web.UI.MVC;


namespace Century.Web.MVC.AdminArea
{
    public class SiteSelectorController : CenturyAdminBaseController
    {
        public ActionResult Index()
        {
            return View(Token);
        }

        public string CountrySiteChange(int? selectedCountrySiteId)
        {
            // set current site
            if (selectedCountrySiteId.HasValue)
            {
                Session["CurrentSiteId"] = selectedCountrySiteId;
            }
            else
            {
                Session["CurrentSiteId"] = Token.AccessibleSites.First().Id;
            }
            Response.Redirect("/AdminArea");
            return string.Empty;
        }
    }
}
